<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMobileSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mobile_sms', function (Blueprint $table) {
            $table->increments('id');
            $table->string('type')->comment('短信类型： auth_code 验证码；sms 短消息；');
            $table->string('platform')->default(0)->comment('0 前台用户；1 后台用户');
            $table->string('mobile')->comment('手机号');
            $table->string('content')->comment('消息内容');
            $table->string('code')->nullable()->comment('验证码');
            $table->string('remark')->nullable()->comment('备注');
            $table->integer('status')->default(0)->comment('状态： 0 未发送 1 已发送 2 发送失败');
            $table->timestamps();

            $table->index('type');
            $table->index('mobile');
            $table->index('code');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mobile_sms');
    }
}
